﻿@{
    Layout = null;
}

<!DOCTYPE html>

<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="width=device-width" />
    <link href="~/Content/bootstrap/css/bootstrap.min.css" rel="stylesheet" />
    <script src="~/Scripts/jquery-2.1.1.min.js"></script>
    <script src="~/Content/bootstrap/js/bootstrap.js"></script>
    <script src="~/Scripts/layer/layer.js"></script>
    <link href="~/Content/bootstrap/css/base.css" rel="stylesheet" />
    <title>客户管理</title>
    <style type="text/css">
        .container-fluid {
            padding: 0;
            margin: 0;
        }

        #lv_lb {
            background-color: #009944;
            text-align: center;
            font-weight: bold;
            font-size: 20px;
            height: 60px;
            line-height: 60px;
        }

        ul {
            margin: 0 25px 0 25px;
            padding: 0;
        }

            ul li {
                list-style: none;
                line-height: 50px;
            }

        .sp_title {
            padding: 0;
            margin: 0 25px 0 25px;
            background: #EDEDED;
            padding-left: 10px;
            font-weight: bold;
        }

        li {
            padding-left: 0;
            font-weight: bold;
        }


        .tog_block {
            display: block;
        }

        .top_p {
            transform: rotate(180deg);
            transition: all 0.4s ease;
        }

        .top_ps {
            transform: rotate(0deg);
            transition: all 0.4s ease;
        }

        p {
            float: right;
            line-height: 50px;
        }

        .hz_company {
            display: none;
        }

        .jsbig_company {
            border-bottom: 1px solid #EDEDED;
            border-radius: 4px;
        }

        .big_company {
            border: 1px solid #EDEDED;
            padding-left: 10px;
        }

        .sml_company {
            border: 1px solid #EDEDED;
            padding-left: 10px;
            border-radius: 4px;
        }

        .big_ul {
            border: 1px solid #EDEDED;
            border-radius: 4px;
        }

        .sml_ul {
            border: 1px solid #EDEDED;
            border-radius: 4px;
        }
    </style>

    <script>
        var pageindex = 1;
        var pagesize = 5;
        $(function () {
            Info();
        });
        function Info() {
            $('.big_ul').html("");
            //我的证书
            $("#left").css("background-color", "#F3A433");
            $("#right").css("background-color", "white");
            $(".big_ul").css("border", "0px");
            $.ajax({
                type: "GET",
                url: "/Certificate/Get_IndexInfo",
                data: {},
                dataType: "json",
                async: false,
                success: function (data) {
                    if (data.MessageCode == "0") {

                        var _html = "<li><img src=" + data.img + "></li>"
                        $('.big_ul').append(_html);
                    } else {

                        var _html = "<li><span>您还未被授权</span></li>"
                        $('.big_ul').append(_html);
                    }

                }
            })

        }


        function Shenhe() {
            $('.big_ul').html("");
            $("#right").css("background-color", "#F3A433");
            $("#left").css("background-color", "white");
            $(".big_ul").css("border", "1px solid #EDEDED");
            $.ajax({
                type: "GET",
                url: "/Certificate/query_parAgList",
                data: {},
                dataType: "json",
                async: false,
                success: function (data) {
                    if (data.MessageCode == "0") {
                        if (data.PagencyList != null) {
                            $.each(data.PagencyList, function (i, n) {
                                var states = "已审核";
                                var ht = n.state == 1 ? "<input type='button'style='background-color:#F3A433;border:0; color:white;height:28px;width:35%; '  onclick='pass(" + n.id + "," + n.agency_id + ")' value='审核'/>" : n.state == 2 ? "" : "";
                                var _html = "<li><div class='sml_company'  onclick='clicks(this)'>" +
                         " <span>" + n.name + "</span><span style='float:right;margin-right:20px;'>状态：" + states + "</span></div><ul class='hz_company'>" +
                          " <li>等级:" + n.level_name + "</li>" +
                         " <li><a href=\"/Certificate/ShareImg?agency_id=" + n.id + "\">查看授权证书</a></li>" +
                          "</ul></li>";
                                $('.big_ul').append(_html);
                                //$("#yes_sh").show();
                            });
                        } else {
                            $(".big_ul").css("border", "0px");
                            var _html = "<li><span>暂无下级</span></li>"
                            $('.big_ul').append(_html);
                        }
                    } else {
                        layer.msg("查询失败，请稍后再试！");
                    }
                }
            })

        }


        //点击ul下方显示
        function clicks(obj) {
            $(obj).parent().siblings('li').children().siblings('ul').hide(500);
            $(obj).siblings('ul').toggle('tog_block');
            if ($(obj).children('span').children('p').hasClass('top_p')) {
                $(obj).children('span').children('p').removeClass('top_p').addClass('top_ps');
            } else {
                $(obj).children('span').children('p').addClass('top_p').removeClass('top_ps');
            }
            $(obj).addClass('jsbig_company');

        }
        //加载更多
        function loadingLoad(obj, state) {
            pageindex++;
            Shenhe(obj, state, 1);
        }
        ///
        function pass(id, agency_id) {
            window.location.href = "/Examine/Info?id=" + id + "&agency_id=" + agency_id;

        }
    </script>
</head>
<body>
    <div class="container-fluid">
        <div class="row-fluid">
            <div id="left" class="span6" onclick="Info();" style="background-color: #F3A433; font-size: 20px; height: 50px; line-height: 50px; text-align: center; ">
                <span>我的证书</span>
            </div>
            <div id="right" class="span6" onclick="Shenhe()" style="background-color:white; font-size: 20px; height: 50px; line-height: 50px; text-align: center;">
                <span>下级证书</span>
            </div>
        </div>
    </div>

    <div class="container-fluid" id="yes_sh">
        <div class="row-fluid" id="yes_shs">
            <div class="span12" style=" padding-top:30px;">
                <ul class="big_ul"></ul>
            </div>
        </div>
        <div id="loading">


        </div>
    </div>


    <div class="container-fluid">
        <div class="row-fluid">
            <div class="span12" style="text-align:center;">
                <span class="navbar navbar-fixed-bottom" style="color: #B2B2B2;">技术支持：上海诺标</span>
            </div>
        </div>
    </div>
    <div id="sel_name" style="display: none; margin-top: 20px; text-align: center;">
        <select class="selects" id="sel_level" par="par" style="width: 180px;">
            <option value="-1">请选择</option>
        </select>
    </div>
    <div class="serp_quick_but">
        <a id="ab" class="quick_menu"></a>
        <a href="../Home/Index" id="a1" class="quick_menu_back small"><span>首页</span></a>
        <a href="../Certificate/Index" id="a2" class="quick_menu_fahuo small"><span>证书</span></a>
        <a href="../Examine/Index" id="a4" class="quick_menu_clienk small"><span>用户</span></a>
        <a href="../WechartShare/Index" id="a4" class="quick_menu_clienk small"><span>邀请</span></a>
        <a href="../Sqauthorization/Index" id="a3" class="quick_menu_shaom small"><span>申请</span></a>
        <a href="../Password/Index" id="a4" class="quick_menu_clienk small"><span>密码</span></a>
        <a href="../Login/ClearSession" id="a5" class="quick_menu_follow small"><span>退出</span></a>
    </div>
    <style type="text/css">
        .serp_quick_but {
            position: fixed;
            width: 300px;
            height: 60px;
            bottom: 0px;
            right: 5px;
        }

            .serp_quick_but a {
                display: block;
                position: absolute;
                text-align: center;
                text-decoration: none;
            }

                .serp_quick_but a span {
                    font-size: 12px;
                    line-height: 94px;
                    color: #000;
                }

        a.small {
            width: 36px;
            height: 36px;
            background: #d5d5d5;
            border-radius: 30px;
            border: 2px solid #fff;
            background: url(../Content/images/pic02.png) no-repeat rgba(0,0,0,0.4);
            background-size: auto 70px;
        }

        a:hover.small {
            border: 2px solid #fc4e2b;
            background: #fff;
        }

        .serp_quick_but a.quick_menu {
            right: 5px;
            top: -5px;
            width: 40px;
            height: 40px;
            background: url(../Content/images/pic02.png) no-repeat;
            background-size: auto 40px;
        }

        .serp_quick_but a.quick_menu_back {
            right: 55px;
            top: -5px;
            background-position: -69px -18px;
            display: none;
        }

        .serp_quick_but a.quick_menu_fahuo {
            right: 105px;
            top: -5px;
            background-position: -100px -18px;
            display: none;
        }

        .serp_quick_but a.quick_menu_shaom {
            right: 155px;
            top: -5px;
            background-position: -137px -18px;
            display: none;
        }

        .serp_quick_but a.quick_menu_clienk {
            right: 205px;
            top: -5px;
            background-position: -169px -18px;
            display: none;
        }

        .serp_quick_but a.quick_menu_follow {
            right: 255px;
            top: -5px;
            background-position: -209px -18px;
            display: none;
        }
    </style>
    <script>
        //左下方导航
        $(function () {
            var i = 0;
            $("#ab").click(function () {
                i++;
                if (i % 2 == 0) {
                    $("#a1").hide();
                    $("#a2").hide();
                    $("#a3").hide();
                    $("#a4").hide();
                    $("#a5").hide();
                }
                else {
                    $("#a1").show();
                    $("#a2").show();
                    $("#a3").show();
                    $("#a4").show();
                    $("#a5").show();
                }
            })
        })
    </script>
</body>
</html>
